<?php
define('WEB_PATH', dirname(dirname(dirname(__FILE__))).'/');
$config = require WEB_PATH.'Conf/config.php';
$key = '';


// 浏览器重定向,需要友好提示界面给用户
if ($_GET['r9_BType'] == 1) {
	$qs = iconv('gbk', 'utf-8', urldecode($_SERVER['QUERY_STRING']));
	header('Location:http://www.'.$config['ROOT_DOMAIN'].'/index.php?m=Payment&a=callbackReturn&__pay_channel_sign=alipay&'.$qs);
	exit;
} 

if ($p1_MerId != $_GET['p1_MerId']) {
	echo 'failure';
	exit;
}


// 服务器端点对点通讯
$_GET['m'] = 'Payment';
$_GET['a'] = 'alipayCallback';
include(WEB_PATH.'index.php');